import { CookieService } from 'ngx-cookie';
import { SessionStorage } from './session-storage';
import { Injectable } from '@angular/core';

declare var cc: any;

@Injectable()
export class TokenService {

    constructor(private cookieService: CookieService) { }

    setToken(token: string) {
        SessionStorage.setItem('token', token);
        cc.cambioPay.setToken(token);
        this.cookieService.put('token', token, {
            path: '/'
        });
    }

}
